"""
沟通日志页面
"""
from selenium.webdriver.common.by import By
from page.base_page import BasePage

class CommunicationLogPage(BasePage):
    #定位器
    #添加按钮
    xs_xsxq_gtrz_add_locator = (By.XPATH, '//*[@id="tab2"]/div[1]/div[2]/a')
    #标题
    xs_xsxq_gtrz_add_bt_locator = (By.ID, "subject")
    #内容
    xs_xsxq_gtrz_add_nr_locator = (
    By.CSS_SELECTOR, "#dialog-log > form > table > tbody > tr:nth-child(3) > td:nth-child(2) > textarea")
    #下次联系时间
    xs_xsxq_gtrz_add_xclxsj_locator = (By.ID, "nextstep_time")
    #下次联系内容
    xs_xsxq_gtrz_add_xclxnr_locator = (By.ID, "nextstep")
    #确定按钮
    xs_xsxq_gtrz_add_tj_locator = (By.XPATH, "/html/body/div[10]/div[2]/form/table/tbody/tr[5]/td[2]/input[1]")

    #点击添加按钮
    def click_add(self):
        self.driver.find_element(*self.xs_xsxq_gtrz_add_locator).click()

    #输入标题
    def input_bt(self,bt):
        self.driver.find_element(*self.xs_xsxq_gtrz_add_bt_locator).send_keys(bt)

    #输入内容
    def input_nr(self,nr):
        self.driver.find_element(*self.xs_xsxq_gtrz_add_nr_locator).send_keys(nr)

    #输入下次联系时间
    def input_xclxsj(self,xclxsj):
        self.driver.find_element(*self.xs_xsxq_gtrz_add_xclxsj_locator).send_keys(xclxsj)

    #输入下次联系内容
    def input_xclxnr(self,xclxnr):
        self.driver.find_element(*self.xs_xsxq_gtrz_add_xclxnr_locator).send_keys(xclxnr)

    #点击提交按钮
    def click_tj(self):
        self.driver.find_element(*self.xs_xsxq_gtrz_add_tj_locator).click()

